cmake_minimum_required(VERSION 3.10)

project(lv_drivers)

set(lv_drivers_sources
  camera/camera_api.c
  common/backlight.c
  common/media_clock.c
  common/utils.c
  common/i2c.c
  common/lv_pm.c
  common/pwm.c
  common/mfp.c
  charger/power.c
  charger/power_charger.c
  charger/power_nvm.c
  display/crane_lcdc.c
  display/scaler.c
  display/crane_lcd_spi.c
  display/crane_lcd_mcu.c
  display/fbdev.c
  display/monitor.c
  display/R61581.c
  display/SSD1963.c
  display/ST7565.c
  display/st7789v_spi.c
  display/gc9307_spi.c
  display/gc9107_spi.c
  display/st7789v_mcu.c
  display/st7735s_spi.c
  display/st7735s_generic_spi.c
  display/st7567_generic_spi.c
  display/gc9307_generic_spi.c
  display/gc9107_generic_spi.c
  display/st7567_spi.c
  display/crane_lcd_mipi.c
  display/crane_lcd_mipi_dsi.c
  display/crane_lcd_mipi_dphy.c
  display/rm69330_mipi.c
  display/icna3310_mipi.c
  display/ili9806e_mipi.c
  display/st7796_mipi.c
  display/pll2_fc.c
  indev/AD_touch.c
  indev/crane_watch_keypad.c
  indev/evdev.c
  indev/FT5406EE8.c
  indev/ft6x36.c
  indev/ft6x36_upgrade_firmware.c
  indev/ft6x36_upgrade_func.c
  indev/touch_tracker.c
  indev/zinitix.c
  indev/keyboard.c
  indev/mouse.c
  indev/mousewheel.c
  indev/XPT2046.c
  jpeg/crane_jpuc_common.c
  jpeg/crane_jpuc_dma.c
  jpeg/crane_jpuc_decoder.c
  jpeg/crane_jpuc_encoder.c
  win_drv.c
)

# Add the static library
add_library(lv_drivers STATIC ${lv_drivers_sources})
target_include_directories(lv_drivers PRIVATE ${SDL2_INCLUDE_DIRS} ${PRODUCT_CONFIG_DIR} ${LVGL_DIR})

set(lv_drivers_ram
  common/dma.c
  common/spi_arch.c
  display/st_lcd_spi_drv.c
  indev/crane_keypadc.c
  indev/crane_evb_keypad.c
  indev/crane_onkey.c
)

add_library(lv_drivers_ram STATIC ${lv_drivers_ram})
target_include_directories(lv_drivers_ram PRIVATE ${SDL2_INCLUDE_DIRS} ${PRODUCT_CONFIG_DIR} ${LVGL_DIR})